package P4.T03;

import java.util.Comparator;

public class Util {
    public static <T> void Sort(T[] datas, Comparator<T> comporator) {
        for (int i = 0; i < datas.length; i++) {
            for (int j = i + 1; j < datas.length; j++) {
                if (comporator.compare(datas[i], datas[j]) > 0) {
                    T temp = datas[i];
                    datas[i] = datas[j];
                    datas[j] = temp;
                }
            }
        }
    }
}
